﻿@model Employee
<form class="form-horizontal uiform" method="post"
      data-modal="true"
      data-table=".uitable"
      data-error-el=".alert-danger"
      data-on-submit-success="fx.mtfSuccess"
      action="@Url.Action("Save")">
    <div class="modal-header">
        <button class="close" data-dismiss="modal" type="button" aria-label="Close">
            <span aria-hidden="true">&times;</span>
        </button>
        <h4 class="modal-title">@Html.EditStatus("人员信息")</h4>
    </div>
    <div class="modal-body">
        @Html.AntiForgeryToken()
        @Html.MarkCreate()
        @Html.HiddenFor(p => p.Id)
        <div class="alert alert-danger fxhide"></div>
        <div class="form-group">
            <label class="control-label col-md-3">
                <span class="required"> * </span>
                姓名：
            </label>
            <div class="col-md-8">
                <input class="form-control" name="@nameof(Model.Name)" value="@Model.Name"
                       data-validate="required: true,maxlength: 10"
                       data-validate-message="required:'请输入姓名'"
                       type="text" autocomplete="off" />
            </div>
        </div>
        <div class="form-group">
            <label class="control-label col-md-3">
                手机：
            </label>
            <div class="col-md-8">
                <input class="form-control" name="@nameof(Model.Phone)" value="@Model.Phone"
                       data-validate="maxlength: 11,isPhone:true"
                       type="text" autocomplete="off" />
            </div>
        </div>
        <div class="form-group">
            <label class="control-label col-md-3">
                部门：
            </label>
            <div class="col-md-8">
                <input class="form-control" name="@nameof(Model.Dept)" value="@Model.Dept"
                       data-validate="maxlength: 50"
                       type="text" autocomplete="off" />
            </div>
        </div>
        <div class="form-group">
            <label class="control-label col-md-3">
                <span class="required"> * </span>
                账号：
            </label>
            <div class="col-md-8">
                <select class="form-control uiselect" name="@nameof(Model.UserId)"
                        data-text-field="UserAccount"
                        data-validate="required: true"
                        data-validate-message="required:'请选择账号'">
                    <option></option>
                    @Html.SystemUserOption(Model.UserId)
                </select>
            </div>
        </div>
        <div class="form-group">
            <label class="control-label col-md-3">
                <span class="required"> * </span>
                稽查点：
            </label>
            <div class="col-md-8">
                <select class="form-control uiselect" name="@nameof(Model.PointId)"
                        data-text-field="PointName"
                        data-validate="required: true,maxlength: 50"
                        data-validate-message="required:'请选择稽查点'">
                    <option></option>
                    @Html.CheckPointsCategoryOption(Model.PointId)
                </select>
            </div>
        </div>
        <div class="form-group">
            <label class="control-label col-md-3">
                有效：
            </label>
            <div class="col-md-8">
                <input class="uiswitch" name="@nameof(Model.Enabled)"
                       data-on-text="有效" data-off-text="无效" data-size="small"
                       type="checkbox" @Html.IsChecked(Model.Enabled)>
            </div>
        </div>
        <div class="form-group">
            <label class="control-label col-md-3">
                备注：
            </label>
            <div class="col-md-8">
                <textarea class="form-control" name="@nameof(Model.Note)"
                          data-validate="maxlength: 200"
                          rows="3">@Model.Note</textarea>
            </div>
        </div>
    </div>
    <div class="modal-footer">
        <button class="btn btn-primary" type="submit">
            <i class="fa fa-save"></i> 保存
        </button>
        <button class="btn btn-default" type="button" data-dismiss="modal">
            <i class="fa fa-sign-in"></i> 关闭
        </button>
    </div>
</form>